package com.smt.ejb3.tutoria.client;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.smt.ejb3.tutoria.entitybean.enum0.Gender;
import com.smt.ejb3.tutoria.entitybean.enum0.Worker;
import com.smt.ejb3.tutoria.entitybean.enum0.WorkerManager;

public class WorkerClient {
	public static void main(String[] args) {
		
		try {
			InitialContext ctx = new InitialContext();

			WorkerManager service = (WorkerManager) ctx
					.lookup("WorkerManagerBean/remote");
			
			Worker w = new Worker();
			w.setGender(Gender.MAN);
			
			service.saveWorker(w);

		} catch (NamingException ex) {
			ex.printStackTrace();
		}
	}
}
